home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / batchut / stnvjw23.zip / SETENV.SYN < prev    next >
Text File  |  1993-05-06  |  12KB  |  442 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6. setenv command line syntax:
  7.  
  8. <prog>    %rce    <variable>    <options>
  9.  
  10. setenv        <variable>    <no value>
  11.                 <value>
  12.                 %chgup
  13.                 %chglo
  14.                 %rep<del><text1><del><text2><del>
  15.                 %prompt    <prompt options> <message>
  16.                 %<operator> [<string>|<var>] [<string>|<var>]
  17.  
  18. <prog>
  19.     setenv program to handle environment variables
  20.  
  21. <variable> or <var>
  22.     the name, the environment variable name
  23.     any valid environment variable you wish to define or re-define
  24.  
  25. <options>
  26.     functions to preform for an environment variable
  27.  
  28. <no value>
  29.     no data entered, so as to erase the variable
  30.  
  31. <value>
  32.     a string of printable characters
  33.     the data portion for the environment variable
  34.     any number of <keys> can be imbedded in the character string
  35.  
  36. <del>
  37.     any one character, to delimit or to quote <text>
  38.     the delimiter must be consistent for the option used
  39.  
  40. <text>
  41.     a string of printable characters
  42.     any variable length text {maximum length 100}
  43.  
  44. <text1>
  45.     a string of printable characters
  46.     any variable length text {maximum length 100}
  47.  
  48. <text2>
  49.     a string of printable characters
  50.     any variable length text {maximum length 100}
  51.  
  52. <string>
  53.     a string of printable characters, enclosed by single or double quotes
  54.     any variable length text {maximum length 100}
  55.  
  56. <number> or <n>
  57.     a string of digits that can be considered a number
  58.     there usually is maximum numeric size for the number's function
  59.  
  60.  
  61.  
  62.  
  63. setenv command line syntax continued:
  64.  
  65. <message>
  66.     a string of printable characters
  67.     is displayed and the response is set into the <variable>
  68.     can have embedded %/<number>/ to create characters
  69.  
  70. <operator>
  71.     any one of the follow logical operators: eq, lt, le, gt, ge
  72.  
  73. <prompt options>
  74.     subfunctions to perform for %prompt
  75.  
  76. <keys>
  77.     special names that are imbedded in <value>
  78.     usually begining  with a % {percent sign}
  79.     a key will denote a special function like %time
  80.  
  81. <special keys>
  82.     special names that are imbedded in <value>, but have arguments
  83.     usually begining  with a % {percent sign}
  84.     a key will denote a special function like %len
  85.  
  86. %rce
  87.     is used when command.com has been called a second time
  88.     to set the environment variable in the root environment space
  89.  
  90. <options>
  91.  
  92.     <no value>
  93.         no data entered
  94.         environment variable by it's self to erase it
  95.  
  96.     <value>
  97.         any length data for the environment variable
  98.         any number of <keys> can be imbedded in the data
  99.  
  100.     %chgup
  101.         change the existing environment variable's data to uppercase
  102.  
  103.     %chglo
  104.         change the existing environment variable's data to lowercase
  105.  
  106.     %rep<del><text1><del><text2><del>
  107.         replace any occurence  of <text1> with any occurence of 
  108.         <text2> in the  existing environment variable
  109.  
  110.     %prompt    <prompt options> <message>
  111.         prompt the display with <messsage> for <variable>'s data
  112.  
  113.  
  114.  
  115.  
  116. setenv command line syntax continued:
  117.  
  118. <options>
  119.  
  120.     %eq [<string>|<variable>] [<string>|<variable>]
  121.         tests if two values are equal
  122.         the value can be a string or variable's content
  123.         a string is a quoted with single or double quotes.
  124.         returns T for true, F for false, or E for error
  125.  
  126.     %lt [<string>|<variable>] [<string>|<variable>]
  127.         tests if value one is less than value two
  128.         the value can be a string or variable's content
  129.         returns T for true, F for false, or E for error
  130.  
  131.     %le [<string>|<variable>] [<string>|<variable>]
  132.         tests if value one is less than or equal value two
  133.         the value can be a string or variable's content
  134.         returns T for true, F for false, or E for error
  135.  
  136.     %gt [<string>|<variable>] [<string>|<variable>]
  137.         tests if value one is greater than value two
  138.         the value can be a string or variable's content
  139.         returns T for true, F for false, or E for error
  140.  
  141.     %ge [<string>|<variable>] [<string>|<variable>]
  142.         tests if value one is greater than or equal value two
  143.         the value can be a string or variable's content
  144.         returns T for true, F for false, or E for error
  145.  
  146. <keys>
  147.     special names that are imbedded in <value>
  148.     usually begining  with a % {percent sign}
  149.     a key will denote a special function like %time
  150.  
  151.     %cwd
  152.         the current working directory, will be "/" if at the top
  153.     %cfd
  154.         the current full directory specification, "/" if at the top
  155.     %date1 or %date
  156.         the current date as dd:mm:yy, day first
  157.     %date2
  158.         the current date as mm:dd:yy, month first
  159.     %date3
  160.         the current date as yy:dd:mm, year first
  161.     %dosv
  162.         MS-DOS major version
  163.     %dosm
  164.         MS-DOS minor version
  165.     %drive
  166.         current working disk drive letter
  167.     %time
  168.         the current time as hh:mm:ss
  169.     %+n
  170.         plus "n"'s disk drive letter from current drive
  171.     %-n
  172.         minus "n"'s disk drive letter from current drive
  173.  
  174.  
  175.  
  176.  
  177.  
  178. setenv command line syntax continued:
  179.  
  180. <special keys>
  181.     %chr<del><number><del>
  182.         returns that ascii code as a character, range 1 - 255
  183.  
  184.     %elem<del><number><del><character><del><variable><del>
  185.         extracts element <number> from the string of elements
  186.         separated by <character>
  187.         '0' the first element if the element precedes the first
  188.         <character>
  189.  
  190.     %mid<del><variable><del><number1><del><number2><del>
  191.         returns a string of length <number1> from
  192.         <variable> starting from <number2>
  193.  
  194.     %loc<del><number><del><variable><del><text><del>
  195.         searches for the first occurrence of the <text>
  196.         in <variable> starting at location <number> and
  197.         returns the offset of <text>
  198.         returns '0' if <text> not found
  199.  
  200.     %len<del><variable><del>
  201.         returns the number of characters in <variable>,
  202.         but only the data portion
  203.  
  204.     %sum<del><variable><del><number><del>
  205.         returns the sum of <number> and <variable>
  206.         <number> can be negative
  207.  
  208. <del>
  209.     any one character, to delimit or to quote <text>
  210.     the delimiter must be consistent for the option used
  211.  
  212. <character>
  213.     any one character
  214.  
  215. <variable>
  216.     the name, the environment variable name
  217.     any valid environment variable you wish to define or re-define
  218.  
  219. <text>
  220.     a string of printable characters
  221.     any variable length text {maximum length 20}
  222.  
  223. <number>
  224.     any number from 0 to 255
  225.  
  226. <number1>
  227.     any number from 0 to 255
  228.  
  229. <number1>
  230.     any number from 0 to 255
  231.  
  232.  
  233.  
  234.  
  235.  
  236. setenv command line syntax continued:
  237.  
  238. <prompt options>
  239.  
  240.     %def<def><text><del>
  241.         if no data is entered at the prompt then use <text>
  242.         no data entered is a soul carriage return
  243.  
  244.     %noecho
  245.         when data is entered do not display it
  246.         necessary for passwords, 
  247.         remember to ersae the variable after use
  248.         
  249.     %timo=hh:mm:ss
  250.         exit prompt, if no data is entered in the time hh:mm:ss 
  251.         if no %def accompanies this option then %def// is assumed
  252.         ss for seconds, mm:ss for minutes, hh:mm:ss for hours
  253.  
  254.     %upper
  255.         convert prompted / entered data to uppercase
  256.  
  257.     %lower
  258.         convert prompted / entered data to lowercase
  259.  
  260.     %readkey
  261.         read one key stroke, without needing the carriage return
  262.         the other <prompt options> are also useful with %readkey
  263.         except %trim (%trim results questionable), %def is 
  264.         usefull when used with %timo
  265.  
  266.     %trim
  267.         trim leading and trailing spaces from entered line
  268.  
  269.  
  270.  
  271.  
  272.  
  273. setenv command examples:
  274.  
  275. To create a variable
  276.     setenv name John Wolchak
  277.  
  278. To erase a variable
  279.     setenv name
  280.  
  281. To prompt a question
  282.     setenv node %prompt Node name to connect to 
  283.  
  284. To prompt passwords
  285.     setenv pass %prompt %noecho Your password 
  286.  
  287. When you want to pass on a string with spaces in it to a batch file
  288.     batfile this_is_a_test
  289.     setenv name %%rep/_/ /
  290.  
  291. When you want to minimize parsing data, use uppercase
  292.     set name=John
  293.     setenv name %%chgup
  294.     or
  295.     setenv name %%prompt %%upper Your first name 
  296.  
  297. To given batch files startup options
  298.     prompt:
  299.     setenv ans %%prompt %%upper %%def/N/ Connect to the Network (Y/N) 
  300.     setenv ans %%rep/ES//
  301.     setenv ans %%rep/ //
  302.     setenv ans %%rep/O//
  303.     if "%ans%" == "Y" goto network
  304.     if not "%ans%" == "N" goto prompt
  305.  
  306. To give batch files startup options, that can be unattendable as well
  307.     prompt:
  308.     setenv ans %%prompt %%upper %%def/N/ %%timo=20 Network Connect (Y/N) 
  309.     if "%ans%" == "Y" goto network
  310.     if not "%ans%" == "N" goto prompt
  311.  
  312. For timing test
  313.     setenv start Starting time %%time
  314.     myporg
  315.     setenv end Ending time %%time
  316.  
  317. For batch proceedures that move around and return
  318.     setenv retdr